const char *prefix_path;
const char *path;
- if (!ostree_parse_refspec (refspec_prefix, &remote, &ref_prefix, error))
- return FALSE;
+ /* special-case "<remote>:" and "<remote>:.", which ostree_parse_refspec won't like */
+ if (g_str_has_suffix (refspec_prefix, ":") ||
+ g_str_has_suffix (refspec_prefix, ":."))
+ {
+ const char *colon = strrchr (refspec_prefix, ':');
+ g_autofree char *r = g_strndup (refspec_prefix, colon - refspec_prefix);
+ if (ostree_validate_remote_name (r, NULL))
+ {
+ remote = g_steal_pointer (&r);
+ ref_prefix = g_strdup (".");
+ }
+ }
+
+ if (!ref_prefix)
+ {
+ if (!ostree_parse_refspec (refspec_prefix, &remote, &ref_prefix, error))
+ return FALSE;
+ }
if (!(flags & OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES) && remote)
{
${CMD_PREFIX} ostree --repo=repo refs | wc -l > refscount.create6
assert_file_has_content refscount.create6 "^11$"
+#Check that we can list just remote refs
+${CMD_PREFIX} ostree --repo=repo refs origin: | wc -l > refscount.create7
+assert_file_has_content refscount.create7 "^2$" # origin:remote1 origin:local1
+#Also support :. for backcompat with flatpak
+${CMD_PREFIX} ostree --repo=repo refs origin:. | wc -l > refscount.create8
+assert_file_has_content refscount.create8 "^2$" # origin:remote1 origin:local1
+
echo "ok refs"
# Test symlinking a ref